//
//  TestView.swift
//  SwiftDemo
//
//  Created by sun on 2020/11/2.
//  Copyright © 2020 sun. All rights reserved.
//

import UIKit

class TestView: UIView {

    override init(frame: CGRect) {
        super.init(frame: frame)
        backgroundColor = .yellow
        
        let button = UIButton(frame: CGRect(x: 0, y: 0, width: 50, height: 50))
        button.backgroundColor = .red
        button.addTarget(self, action: #selector(buttonAction), for: .touchUpInside)
        addSubview(button)
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    @objc func buttonAction() {
        self.triggerSignal(nil, params: nil) 
    }
}
